﻿CREATE TABLE [dbo].[hrm_Employees] (
    [PersonID]     INT           NOT NULL,
    [EmployeeCode] NVARCHAR (50) NOT NULL,
    [DepartmentID] INT           NOT NULL,
    CONSTRAINT [PK_hrm_Employees] PRIMARY KEY CLUSTERED ([PersonID] ASC),
    CONSTRAINT [FK_hrm_Employees_hrm_Departments] FOREIGN KEY ([DepartmentID]) REFERENCES [dbo].[hrm_Departments] ([DepartmentID]),
    CONSTRAINT [FK_hrm_Employees_human_Persons] FOREIGN KEY ([PersonID]) REFERENCES [dbo].[human_Persons] ([PersonID])
);


GO
CREATE UNIQUE NONCLUSTERED INDEX [IX_hrm_Employees]
    ON [dbo].[hrm_Employees]([EmployeeCode] ASC);

